import { format } from "./index";

const timeFilter = function(time, resetformat) {
  resetformat = resetformat || "yyyy-MM-dd hh:mm:ss";
  if (time) {
    return format(new Date(time), resetformat);
  }
};

const askStatusFilter = function(val) {
  switch (val) {
    case 1:
      return "等待房东回复";
    case 2:
      return "等待租客回复";
    case 3:
      return "房东拒绝";
    case 4:
      return "租客拒绝";
    default:
      return "发起合约";
  }
};

const leaseStatusFilter = function(val) {
  switch (+val) {
    case 1:
      return "暂存";
    case 2:
      return "等待租客同意";
    case 3:
      return "租客不同意";
    case 4:
      return "住客毁约";
    case 5:
      return "房东毁约";
    case 6:
      return "租约生效";
    default:
      return "租约过期";
  }
};

const oneStatusFilter = function (val) {
  switch (+val) {
    case 1:
      return ''
    case 2:
      return
    case 3:
      return '不同意'
    default:
      return '同意'
  }
}

const twoStatusFilter = function (val) {
  switch (+val) {
    case 1:
      return ''
    default:
      return '同意'
  }
}

const threeStatusFilter = function (val) {
  switch (+val) {
    case 6:
      return '是'
    default:
      return '否'
  }
}

export default {
  timeFilter,
  askStatusFilter,
  leaseStatusFilter,
  oneStatusFilter,
  twoStatusFilter,
  threeStatusFilter
};
